Page({

  /**
   * 页面的初始数据
   */
  data: {
    // 订单导航栏
    tabs: [{
        key: 0,
        text: '全部'
      },
      {
        key: 1,
        text: '待付款',
        info: ''
      },
      {
        key: 2,
        text: '待发货',
        info: ''
      },
      {
        key: 3,
        text: '待收货',
        info: ''
      },
      {
        key: 4,
        text: '已完成',
        info: ''
      },
    ],
    status: 0,
    value: '',
    orderList: [{
        id: 1,
        orderNumber: '1331231231',
        flag: false,
        orderStatus: '1',
        shop: [{
            shopName: '杜恩医疗止鼾呼吸机家用老人专用全自动无创睡眠暂停打呼噜呼吸器',
            shopImg: 'https://img.alicdn.com/imgextrahttps://img.alicdn.com/imgextra/i4/2214738573364/O1CN01f7D06V1ailB8PUQ7J_!!2214738573364-0-alimamacc.jpg_468x468q75.jpg_.webp',
            shopDesc: '橙黄色 24寸',
            shopPrice: '100.00',
            shopNumber: '4'
          },
          {
            shopName: '欧姆龙3L医用制氧机311W 老人孕妇专用官方家用吸氧机316雾化便携',
            shopImg: 'https://img.alicdn.com/imgextrahttps://img.alicdn.com/imgextra/i4/2894690322/O1CN01Ztmuxv1EFWMYlvoO7_!!2894690322-0-alimamacc.jpg_468x468q75.jpg_.webp',
            shopDesc: '橙黄色 24寸',
            shopPrice: '100.00',
            shopNumber: '4'
          }
        ]
      },
      {
        id: 1,
        orderNumber: '1331231231',
        flag: false,
        orderStatus: '4',
        shop: [{
          shopName: '鱼跃制氧机医用级5L浓度90%吸氧器家用吸氧机老人孕妇氧气机5AW',
          shopImg: 'https://img.alicdn.com/imgextrahttps://img.alicdn.com/imgextra/i4/2928278102/O1CN01KO4LUO29illPRvFo2_!!2928278102-0-alimamacc.jpg_468x468q75.jpg_.webp',
          shopDesc: '橙黄色 24寸',
          shopPrice: '1.00',
          shopNumber: '1'
        }]
      }
    ],
    order: []
  },
  // tab切换
  onTabChange(e) {
    let status = e.detail.value
    if (status == 0) {
      this.setData({
        status,
        order: this.data.orderList
      })
    } else {
      let order = this.data.orderList.filter(item => item.orderStatus == status)
      this.setData({
        status,
        order
      })
    }
  },
  goOrderSearch() {
    wx.navigateTo({
      url: '/pageOrder/order/order-search/index',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData({
      order: this.data.orderList
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})